]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Check the result of fgets() to deal with warn_unused_result
authorOwen W. Taylor <otaylor@fishsoup.net>
Thu, 6 Aug 2009 21:59:20 +0000 (17:59 -0400)
committerOwen W. Taylor <otaylor@fishsoup.net>
Thu, 6 Aug 2009 21:59:20 +0000 (17:59 -0400)
Some C library versions have __attribute__((warn_unused_result)) on
fgets(). We really don't care since we are just throwing the data
away, but check the result anyways.

src/shell-recorder.c

index 2ff7d5a8454e7ca4f40b34a42de0695c68c7f2ac..70f833eb23f1203d5cea38dd212acc4eceecb935 100644 (file)
@@ -221,7 +221,8 @@ get_memory_target (void)
           return mem_total / 2;
         }
       /* Skip to the next line and discard what we read */
-      fgets(line_buffer, sizeof(line_buffer), f);
+      if (fgets(line_buffer, sizeof(line_buffer), f) == NULL)
+        break;
     }
 
   fclose(f);